package assignment2;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;

/**
 * @DESCRIPATION java 8 的优雅聊天
 * @AUTHOR 戴超
 * @DATE 2018/6/19
 **/
public class Client {
    public static void main(String[] args) throws Exception {
        Socket s = new Socket("127.0.0.1", 8888);
        InputStream is = s.getInputStream();
        OutputStream os = s.getOutputStream();

        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
        BufferedReader br = new BufferedReader(new InputStreamReader(is));

        new Thread(new Receiver(br , s)).start();
        new Thread(new Sender(bw, s)).start();
    }
}
